﻿{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<link rel="stylesheet" style="text/css" href="__PUBLIC__/Css/front/news.css?version={$version}">
{/block}
{block name="content"}
{if $notice_list}
<div class="help_list">
	<ul class="help_ul" id="going_list">
    {foreach from=$notice_list item=notice}
    <li class="help_li">
    	<a href="{$notice_detail_link}{$notice.notice_id}">
  			{$notice.title}
  		</a>
    </li>
    {/foreach}
	</ul>
</div>
{else}
<div class="simple_error">
	—————&nbsp;&nbsp;&nbsp;没有信息了&nbsp;&nbsp;&nbsp;—————
</div>
{/if}
{/block}
{block name="js"}
<script type="text/javascript">  
var firstRow = parseInt('{$firstRow}');
var total = parseInt('{$total}');
{literal}
  $(function(){  
    var range = 100; //距下边界长度/单位px  
    var elemt = 500; //插入元素高度/单位px  
    var num = firstRow;  
    var totalheight = 0;  
    var main = $("#going_list"); //主体元素  
    $(window).scroll(function(){  
      var srollPos = $(window).scrollTop(); //滚动条距顶部距离(页面超出窗口的高度)   
      totalheight = parseFloat($(window).height()) + parseFloat(srollPos);  
      if(($(window).height()-range) <= totalheight  && total > num)
      {  
        num = parseInt(num) + parseInt(firstRow);
        //获取商品列表
        $.post('/FrontNews/get_notice_list', {"firstRow":num - parseInt(firstRow)}, function(data, textStatus) 
         {
          if (data != 'failure')
          {
            var len = data.length;
            for (i = 0; i < len; i++)
            {
              var html = '<li class="help_li"><a href="/FrontNews/notice_detail/id/' + data[i].notice_id + '">' + data[i].title + '</a></li>';
               main.append(html);
            }
 
          }
        }, 'json');
      } 
       else
      {
        $('#item_ending').show();
      }
    }); 
    
  });  
</script>      
{/literal}
{/block}
